<template>
<div>
	<x-header> 办理历史 <router-link to="/" slot="right"> <a class="fa fa-home fa-15x"></a> </router-link></x-header>
	<div>
		<ab-scroller v-if="OpinionStatus" url="/bpm/my/approveList?supportMobile$V=true" :conditions='[{key:"inst.subject_^VLK",value:"标题"}]'>
			<div slot-scope="slotScope">
				<!-- <cell v-for="(task,index) in slotScope.rows" :title="task.nodeName" :key="index" :inline-desc="task.subject" :link="{path:'/bpm/instanceDetail',query:{instanceId: task.id,nodeId:task.nodeId}}" >
					<div>
						<span v-if="OpinionStatus[task.approveStatus]" :class="'weui-btn weui-btn_mini weui-btn_plain-' + OpinionStatus[task.approveStatus].labelCss">{{OpinionStatus[task.approveStatus].value}}</span>
						<span v-else>无枚举：{{task.approveStatus}}</span>
					</div>
				</cell> -->
				<div  v-for="(task,index) in slotScope.rows" :key="task.id" >
					<router-link :to="{path:'/bpm/instanceDetail',query:{instanceId: task.id,nodeId:task.nodeId}}">
						<div class="gz-card gz-list-style">
							<div class="title-box">
							<slot name="title">
								<div class="card-item">
									<div class="card-item" style="flex: 1;">
										<div class="item-title">办理时间：</div>
										<div class="item-value">{{task.approveTime}}</div>
									</div>
									<div :class="'item-status weui-btn_plain-' + OpinionStatus[task.approveStatus].labelCss">
										<span v-if="OpinionStatus[task.approveStatus]">{{OpinionStatus[task.approveStatus].value}}</span>
										<span v-else>无枚举：{{task.approveStatus}}</span>
									</div>
								</div>
							</slot>
							<div class="left-dot"></div>
							<div class="right-dot"></div>
							</div>
							<div class="content-box">
							<slot name="content">
								<div class="card-items">
									<div class="card-item">
										<div class="item-title">任务标题：</div>
										<div class="item-value">{{task.nodeName}}</div>
									</div>
									<div class="card-item">
										<div class="item-title">任务描述：</div>
										<div class="item-value">{{task.subject}}</div>
									</div>
								</div>
							</slot>
							</div>
							<div class="footer-box">
							<slot name="footer">
								<div class="btn-group">
									<div class="btn btn-primary">查看</div>
								</div>
							</slot>
							</div>
						</div>
					</router-link>
				</div>
			</div>
		</ab-scroller>
	</div>
</div>
</template>

<script>

import Vue from 'vue';

export default {
	data: function () {
	  return {
		  tasks:[],
		  OpinionStatus : null,
	  }
	},
	created : function(){
		var post = this.abTools.getEnum("com.dstz.bpm.api.constant.OpinionStatus",true);
		var that = this;
		post.then(function(data){
			that.OpinionStatus = {};
			data.forEach(function(item){
				that.OpinionStatus[item.key] = item;
				if(!item.labelCss||["default","success","primary"].includes(item.labelCss)){
					item.labelCss = "primary";
				}else{
					item.labelCss = "warn";
				}
			});
			console.info(that.OpinionStatus)
		});
	},
	methods: {
	}
}
</script>
<style scoped lang="less">
	
	/deep/._v-container{
		border-top: 0.5em solid rgba(0,0,0,0) !important;
	}
	
</style>
